# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer:
pkgname=powertop
pkgver=2.14
pkgrel=0
pkgdesc="Power consumption monitor"
url="https://01.org/powertop"
arch="all"
license="GPL-2.0-only"
makedepends="linux-headers ncurses-dev pciutils-dev zlib-dev libnl-dev
	gettext-dev automake autoconf libtool autoconf-archive"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/fenrus75/powertop/archive/v$pkgver.tar.gz
	musl-fix-headers.patch
	"

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	LIBS="-lintl" ./configure --prefix=/usr --disable-nls
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
f3e25901fb29405e0c8016643855a209cf9dba589fe9dd3e27c291d44699cebeb00dc8c7264c24436db08deb496759bd106666cb52d9ebd5f831bbb99e30f20f  powertop-2.14.tar.gz
d3bb0e8eaa56fe9ef5aed5d7bea4860be2135fc163ec0c669dc2d01f5ee46ee22ee58cac0835518dc1a4e2939748cf57f2ab37e8d0d879bbc0161d66db7d1919  musl-fix-headers.patch
"
